<%--
 *  File:    TextPop4DBArchive.jsp
 *  @Author: Jamesli
 *  Date:    2010/09/08
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.TextPop4DBArchive"); 

  //init param
  String strModuleName = "CM";
  String privilegeCode = "ALL";
  String contextPath = request.getContextPath();
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>TextPop4DBArchive</title>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<script>
<%
	String targetname = request.getParameter("target");
	if(targetname == null) targetname = "";
	String readonly = request.getParameter("readonly");
	if(readonly == null) readonly = "N";
	String readonlyHTML = "";
	if(readonly.equalsIgnoreCase("Y"))readonlyHTML = "readonly='readonly'";
%>
var targetname = "<%=targetname%>";
function page_onload(){
	if(targetname != ""){
		cform.content.value = eval("opener.document.cform." + targetname + ".value");
	}
}

 function page_confirm(){
	if(targetname != ""){
		eval("opener.document.cform." + targetname).value = cform.content.value;
		this.close();
	}
 }

 function checklength(){
	var length4check = 2000;
	<%if(targetname.contains("arcconditiondesc")){ %>
	length4check = 500;
	<%}%>
	var length  = cform.content.value.length;
	if(length > length4check){
		var value = cform.content.value;
		cform.content.value = value.substring(0, length4check);
	}
 }
</script>
</head>
<body onload="page_onload()">
<% //--------------------------------------  page location --%>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<form name="cform">
	<tr><td class="title_center">
			<%if(targetname.contains("arcconditiondesc")){ %><%= label.getLabelName("L_ArchiveConditionDesc") %>
			<%}else{ %><%= label.getLabelName("L_ArchiveCondition") %>
			<%} %>
		</td></tr>
  	<tr><td class="td_center"><textarea name="content" rows="15" cols="80" onkeydown="checklength()" <%=readonlyHTML %>></textarea></td></tr>	
    <tr> 
      <td class="summary_top"></td>
    </tr>
    <tr> 
      <td class="td_center">
      	<%if(!readonly.equalsIgnoreCase("Y")){ %>
      	<a onclick="page_confirm()"><custom:button type="1" label="L_OK" imgsrc="edit.gif" border="0" style="width:80"/></a>
      	<%} %>
      	<a onclick="javascript:window.close();"><custom:button type="1" label="L_Cancel" imgsrc="edit.gif" border="0" style="width:80"/></a>
      </td>
    </tr>
	</form>
</table>
</body>
</html>